import { v4 as uuid } from "uuid";

export interface PaymentDetailItem {
  orderId: string
  orderDetailId: string
  productId: string
  productSpecId: string
  quantity: number
  price: number
  amount: number
}

export interface CreatePaymentParams {
  orderId: string
  userId: string
  payType: string
  amount: number
}

export interface CreatePaymentResult {
  paymentSerialNumber: string,
  transationNo: string
}


// 创建预支付单
export const createPayment = async (p: CreatePaymentParams): Promise<CreatePaymentResult> => {
  let serialNumber = uuid()
  let transationNo = uuid()
  return {
    paymentSerialNumber: serialNumber,
    transationNo
  }
}